<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    {include file="public/header" /}
    <style>
        html, body {
            background-color: #eee;
        }
        .padding-1{
            padding:1px;
        }
        .relative{
            position: relative;
        }
        #search_bar{
            position: fixed;
            left:0;right: 0;
            top: 0;
            z-index: 1;
        }
        #list{
            margin-top: 40px;
        }
        .weui_search_inner{
            padding-left: 10px;
            padding-right: 10px;
        }
    </style>
    <script>

    </script>
</head>
<body>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">发票代码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="fpdm" name="fpdm" type="text" value="4400144160" placeholder="请输入发票代码">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">发票号码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="fphm" name="fphm" type="text" placeholder="请输入发票号码" value="00208689">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">开票日期</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="kprq" name="kprq" type="text" placeholder="请输入开票日期" value="20170405">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">开票金额</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="kjje" name="kjje" type="text" placeholder="请输入开票金额" value="1019.42">
        </div>
    </div>
    <div class="weui_cell weui_vcode">
        <div class="weui_cell_hd"><label class="weui_label" id="yzminfo">验证码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="yzm" name="yzm"  type="text" placeholder="请输入验证码">
        </div>
        <div class="weui_cell_ft" onclick="getYzmxx()">
            <img src="xxxx" id="yzm_img">
        </div>
    </div>
    <a href="javascript:;" id="checkfp" class="weui_btn weui_btn_primary">查询</a>

</div>
<script src="__STATIC__/js/fastclick.js"></script>
<script src="//libs.baidu.com/jquery/1.10.1/jquery.min.js"></script>
<script src="__STATIC__/jquery-weui/0.8.2/js/jquery-weui.min.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="application/javascript">
    var VVV = 'V1.0.04_001';
    var fplx = 0 ;
    $(function () {
        $('#fpdm').blur(function() {
            var fpdm = $("#fpdm").val().trim();
            if (fpdm.length == 10 || fpdm.length == 12) {
                afcdm(fpdm)
            } else {
                alert("发票代码有误!");
            }
            acb(fplx)
        });
        $("#checkfp").click(function() {
            var fpdm = $("#fpdm").val().trim();
            var fphm = $("#fphm").val().trim();
            var kprq = $("#kprq").val().trim();
            var dmchek = getSwjg(fpdm, 1);
            var area = dmchek[2];
            if (dmchek.length > 0) {
                var DATE_FORMAT = /^[0-9]{4}[0-1]?[0-9]{1}[0-3]?[0-9]{1}$/;
                if (DATE_FORMAT.test(kprq)) {} else {
                    alert("日期格式错误，为YYYYMMDD格式！", "提示");
                    return
                }
                var kjje = $("#kjje").val().trim();
                if (aur()) {
                    $('#checkfp').hide();
                    $('#uncheckfp').show();
                    var date = new Date();
                    var yzm = $("#yzm").val().trim();
                    var setText = "";
                    var param = null;
                    var url = "";
                    if (avai(fplx)) {
                        if (fplx == "01" || fplx == "02" || fplx == "03") {
                            var index = kjje.indexOf(".");
                            if (index > 0) {
                                var arr = kjje.split(".");
                                if (arr[1] == "00" || arr[1] == "0") {
                                    kjje = arr[0]
                                } else if (arr[1].charAt(1) == "0") {
                                    kjje = arr[0] + "." + arr[1].charAt(0)
                                }
                            }
                        }
                        var sjip = dmchek[1];
                        url = sjip + "/invQuery";
                        param = {
                            'fpdm': fpdm,//发票代码
                            'fphm': fphm,//发票号码
                            'kprq': kprq,//开票日期
                            'fpje': kjje,//开票金额
                            'fplx': fplx,//发票类型
                            'yzm': yzm,
                            'yzmSj': yzmSj,
                            'index': jmmy,
                            'area': area,
                            //'publickey': $.ck(fpdm, fphm, kprq, kjje, yzmSj, yzm)
                        };
                        if (oldweb == 1) {
                            var iterationCount = 100;
                            var keySize = 128;
                            var iv = CryptoJS.lib.WordArray.random(128 / 8).toString(CryptoJS.enc.Hex);
                            var salt = CryptoJS.lib.WordArray.random(128 / 8).toString(CryptoJS.enc.Hex);
                            var aesUtil = new AesUtil(keySize, iterationCount);
                            url = sjip + "/query";
                            param = {
                                'fpdm': fpdm,
                                'fphm': fphm,
                                'kprq': kprq,
                                'fpje': kjje,
                                'fplx': fplx,
                                'yzm': yzm,
                                'yzmSj': yzmSj,
                                'index': jmmy,
                                'iv': iv,
                                'salt': salt,
                                'area': area,
                                //'publickey': $.ck(fpdm, fphm, kjje, kprq, yzmSj, yzm)
                            }
                        }
                        delayMessage = "发票查验请求失败!";
                        showTime();
                        $.ajax({
                            type: "post",
                            url: url,
                            dataType: "jsonp",
                            data: param,
                            jsonp: "callback",
                            success: function(jsonData) {
                                console.log(JSON.stringify(jsonData));
                                delayFlag = "1";
                                var cyjgdm = jsonData.key1;
                                if (cyjgdm == "1") {
                                    show_yzm = "";
                                    alert("该省尚未开通发票查验功能！", "提示")
                                } else if (cyjgdm == "001") {
                                    if (oldweb == 1) {
                                        show_yzm = "";
                                        var t = jsonData.key5;
                                        eval(t);
                                        var hwxx = jsonData.key3;
                                        var jmbz = "";
                                        if (jsonData.key4.trim() != '') {
                                            jmbz = aesUtil.decrypt(jsonData.key8, jsonData.key7, jsonData.key9, jsonData.key4)
                                        }
                                        var jmsort = aesUtil.decrypt(jsonData.key8, jsonData.key7, jsonData.key9, jsonData.key10);
                                        var tt = jsonData.key6;
                                        jsname = jsonData.key11 + ".js";
                                        eval(tt);
                                        if (browser == "edge" || browser == "firefox") {
                                            sessionStorage["jsname"] = jsname;
                                            $.getScript("js/" + jsname, function() {
                                                show_dialog(1100, 700, "cyjgedge" + fplx + ".html", result)
                                            })
                                        } else if (browser == "ie8") {
                                            sessionStorage["jsname"] = jsname;
                                            sessionStorage["browser"] = "ie8";
                                            var str = JSON.stringify(result);
                                            sessionStorage["result"] = str;
                                            $.getScript("js/" + jsname, function() {
                                                show_dialog(1100, 700, "cyjgedge" + fplx + ".html", result)
                                            })
                                        } else {
                                            sessionStorage["jsname"] = jsname;
                                            $.getScript("js/" + jsname, function() {
                                                sessionStorage["rule"] = rule;
                                                window.showModalDialog('cyjg' + fplx + '.html', result, "dialogTop:10px;dialogWidth:1100px;dialogHeight:700px;")
                                            })
                                        }
                                    } else {
                                        show_yzm = "";
                                        var key5 = jsonData.key5;
                                        var hwxx = jsonData.key3;
                                        var key2 = jsonData.key2;
                                        var bz = jsonData.key4.trim();
                                        if (key5 != "1") {
                                            var signflag = $.vsign(fplx, fpdm, jsonData.key2, key5);
                                            if (signflag) {
                                                key2 = $.endetail(fplx, fpdm, $.deinv(fplx, fpdm, jsonData.key2));
                                                hwxx = $.deinvkey(fplx, fpdm, jsonData.key3);
                                                bz = $.deinvrm(fplx, fpdm, bz)
                                            } else {
                                                alert("系统异常，请重试！(07)", "系统错误");
                                                return
                                            }
                                        }
                                        if (browser == "edge" || browser == "firefox") {
                                            show_dialog(1100, 700, "cyjgedge" + fplx + ".html", fpdm + '≡' + fphm + '≡' + swjgmc + '≡' + key2 + '≡' + yzmSj + '≡≡≡HWXX≡≡≡' + hwxx + '≡≡≡HWXX≡≡≡' + bz)
                                        } else if (browser == "ie8") {
                                            sessionStorage["browser"] = "ie8";
                                            var str = JSON.stringify(fpdm + '≡' + fphm + '≡' + swjgmc + '≡' + key2 + '≡' + yzmSj + '≡≡≡HWXX≡≡≡' + hwxx + '≡≡≡HWXX≡≡≡' + bz);
                                            sessionStorage["result"] = str;
                                            show_dialog(1100, 700, "cyjgedge" + fplx + ".html", fpdm + '≡' + fphm + '≡' + swjgmc + '≡' + key2 + '≡' + yzmSj + '≡≡≡HWXX≡≡≡' + hwxx + '≡≡≡HWXX≡≡≡' + bz)
                                        } else {
                                            window.showModalDialog('cyjg' + fplx + '.html', fpdm + '≡' + fphm + '≡' + swjgmc + '≡' + key2 + '≡' + yzmSj + '≡≡≡HWXX≡≡≡' + hwxx + '≡≡≡HWXX≡≡≡' + bz, "dialogTop:10px;dialogWidth:1100px;dialogHeight:700px;")
                                        }
                                    }
                                } else if (cyjgdm == "002") {
                                    show_yzm = "";
                                    alert("超过该张发票当日查验次数(请于次日再次查验)!", "提示")
                                } else if (cyjgdm == "003") {
                                    show_yzm = "";
                                    alert("发票查验请求太频繁，请稍后再试！", "提示")
                                } else if (cyjgdm == "004") {
                                    show_yzm = "";
                                    alert("超过服务器最大请求数，请稍后访问!", "提示")
                                } else if (cyjgdm == "005") {
                                    show_yzm = "";
                                    alert("请求不合法!", "提示")
                                } else if (cyjgdm == "020") {
                                    show_yzm = "";
                                    alert("由于查验行为异常，涉嫌违规，当前无法使用查验服务！", "提示")
                                } else if (cyjgdm == "006") {
                                    var key2222 = jsonData.key2;
                                    var key3333 = jsonData.key3;
                                    show_yzm = "";
                                    setText = "不一致";
                                    param = {
                                        'fplx': fplx,
                                        'swjg': swjgmc,
                                        'fpdm': fpdm,
                                        'fphm': fphm,
                                        'kprq': kprq,
                                        'kjje': kjje,
                                        'cysj': yzmSj,
                                        'setText': setText,
                                        'key2222': key2222,
                                        'key3333': key3333
                                    };
                                    if (browser == "edge" || browser == "firefox") {
                                        show_dialog(800, 400, "jgbyz.html", param)
                                    } else {
                                        window.showModalDialog('jgbyz.html', param, "dialogWidth:800px;dialogHeight:400px;center:yes;scroll:no")
                                    }
                                } else if (cyjgdm == "007") {
                                    show_yzm = "";
                                    alert("验证码失效!", "提示")
                                } else if (cyjgdm == "008") {
                                    show_yzm = "";
                                    alert("验证码错误!", "提示")
                                } else if (cyjgdm == "009") {
                                    var key2222 = jsonData.key2;
                                    var key3333 = jsonData.key3;
                                    show_yzm = "";
                                    setText = "查无此票";
                                    param = {
                                        'fplx': fplx,
                                        'swjg': swjgmc,
                                        'fpdm': fpdm,
                                        'fphm': fphm,
                                        'kprq': kprq,
                                        'kjje': kjje,
                                        'cysj': yzmSj,
                                        'setText': setText,
                                        'key2222': key2222,
                                        'key3333': key3333
                                    };
                                    if (browser == "edge" || browser == "firefox") {
                                        show_dialog(800, 400, "jgbyz.html", param)
                                    } else {
                                        window.showModalDialog('jgbyz.html', param, "dialogWidth:800px;dialogHeight:400px;center:yes;scroll:no")
                                    }
                                } else if (cyjgdm == "rqerr") {
                                    show_yzm = "";
                                    alert("当日开具发票可于次日进行查验！", "警告")
                                } else if (cyjgdm == "010") {
                                    show_yzm = "";
                                    var etype = jsonData.key2;
                                    if (etype == 'inredis') {
                                        etype = "(02)"
                                    } else if (etype == 'weberr') {
                                        etype = "(03)"
                                    }
                                    alert("系统异常，请重试！" + etype, "系统错误")
                                } else if (cyjgdm == "010_") {
                                    show_yzm = "";
                                    alert("系统异常，请重试！(05)", "系统错误")
                                } else if (key1 == "016") {
                                    show_yzm = "";
                                    alert("服务器接收的请求太频繁，请稍后再试！", "警告")
                                } else {
                                    show_yzm = "";
                                    alert("系统异常，请重试！(04)", "系统错误")
                                }
                                $('#uncheckfp').hide();
                                $('#checkfp').show()
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {}
                        })
                    }
                }
            }
        });
    });
    function ajy(a) {
        var b = /^\d{6}$/;
        var e = b.test(a);
        return e
    }

    function avym(yzm) {
        var code;
        for (var i = 0; i < yzm.length; i++) {
            code = yzm.charCodeAt(i);
            if ((code > 65248) || (code == 12288)) {
                return false
            }
        }
        return true
    }
    function aje(a, b) {
        var c = alxd(a);
        if (c == "01" || c == "02" || c == "03" || c == "15") {
            return ea(b)
        } else {
            return eb(b)
        }
    }
    function acq(a) {
        var b = /^\d{8}$/;
        var c = /^0{8}$/;
        var d = /^0{11}-?[1-9]*\w\d*$/;
        var e = b.test(a);
        if (e == true) {
            var g = new Date();
            var h = g.getFullYear();
            var i = g.getMonth() + 1;
            var j = g.getDate();
            var k = a.substring(0, 4);
            var l = parseInt(a.substring(4, 6), 10);
            var m = parseInt(a.substring(6), 10);
            var n = ca(0);
            var t = ca(1);
            if ((h != k && h - 1 != k) || l == 0 || l > 12 || m == 0 || m > 31 || a > n || !cb(k, l, m) || (h == k && i == l && j == m)) {
                return false
            }
            if (h - 1 == k && a <= t) {
                return false
            }
            return true
        } else {
            return false
        }
    };
    function ahm(a) {
        var b = /^\d{8}$/;
        var c = /^0{8}$/;
        var d = /^0{11}-?[1-9]*\w\d*$/;
        var e = b.test(a);
        var f = c.test(a);
        if (e == true && f == false) {
            return true
        } else {
            return false
        }
    };
    function adm(a) {
        var b = /^1|0\d{11}$|^\d{6}[1-9]\d{2}0$/;
        var c = /^0{8}[1-9]?\w[1-9]\d*$/;
        var e = b.test(a);
        var f = c.test(a);
        if (e == true && bc(a) && alxd(a) != "99") {
            return true
        } else {
            return false
        }
    }
    function aept(fpdm, fphm, kprq, kjje, yzm) {
        if (fpdm == "" || fphm == "" || kprq == "" || kjje == "") {
            return false
        } else {
            if (yzm == "" || yzm == "请输入验证码") {
                return false
            } else {
                return true
            }
        }
    }
    function alxd(a) {
        var b;
        var c = "99";
        if (a.length == 12) {
            b = a.substring(7, 8);
            for (var i = 0; i < code.length; i++) {
                if (a == code[i]) {
                    c = "10";
                    break
                }
            }
            if (c == "99") {
                if (a.charAt(0) == '0' && a.substring(10, 12) == '11') {
                    c = "10"
                }
                if (a.charAt(0) == '0' && (a.substring(10, 12) == '04' || a.substring(10, 12) == '05')) {
                    c = "04"
                }
                if (a.charAt(0) == '0' && (a.substring(10, 12) == '06' || a.substring(10, 12) == '07')) {
                    c = "11"
                }
                if (a.charAt(0) == '0' && a.substring(10, 12) == '12') {
                    c = "14"
                }
            }
            if (c == "99") {
                if (a.substring(10, 12) == '17' && a.charAt(0) == '0') {
                    c = "15"
                }
                if (c == "99" && b == 2 && a.charAt(0) != '0') {
                    c = "03"
                }
            }
        } else if (a.length == 10) {
            b = a.substring(7, 8);
            if (b == 1 || b == 5) {
                c = "01"
            } else if (b == 6 || b == 3) {
                c = "04"
            } else if (b == 7 || b == 2) {
                c = "02"
            }
        }
        return c
    }
    function cb(a, b, c) {
        if (c > 31) {
            return false
        } else if (c < 1) {
            return false
        } else {
            if (b == 2) {
                if (c > 29) {
                    return false
                }
                if (((a % 4) == 0) && ((a % 100) != 0) || ((a % 400) == 0)) {
                    return true
                } else {
                    if (c > 28) {
                        return false
                    }
                }
            } else if ((b == 4 || b == 6 || b == 9 || b == 11) && c > 30) {
                return false
            }
        }
        return true
    }
    function ca(i) {
        var a = new Date();
        var b = 0;
        var c = 0;
        var d = 0;
        var e = "";
        b = a.getFullYear() - i;
        c = a.getMonth() + 1;
        d = a.getDate();
        e += b;
        if (c >= 10) {
            e += c
        } else {
            e += "0" + c
        } if (d >= 10) {
            e += d
        } else {
            e += "0" + d
        }
        return e
    }
    function ea(a) {
        var b = /(^-?\d{1,11}$)|(^-?\d{1,11}\.\d{1,2}$)/;
        var c = b.test(a);
        return c
    };

    function eb(a) {
        var b = /^-?(\d+$)|(\d+\.\d{1,2})$/;
        var c = b.test(a);
        return c
    };

    function ajy(a) {
        var b = /^\d{6}$/;
        var e = b.test(a);
        return e
    };
    function bc(a) {
        var b;
        var d = new Date();
        var e = d.getFullYear();
        var f = e.toString();
        var g = f.substring(2);
        if (a.length == 12) {
            b = a.substring(5, 7)
        } else {
            b = a.substring(4, 6)
        } if (b <= 00 || b > g) {
            return false
        }
        return true
    }
    function avai(fplx) {
        var fpdm = $("#fpdm").val().trim();
        var fphm = $("#fphm").val().trim();
        var kprq = $("#kprq").val().trim();
        var kjje = $("#kjje").val().trim();
        var yzm = $("#yzm").val().trim();
        var jqbm = "";
        var fpskm = "";
        var flag = 1;
        if (kprq == "YYMMDD") {
            kprq = ""
        }
        if (!aept(fpdm, fphm, kprq, kjje, yzm)) {
            return false
        }
        if (fplx == "99") {
            return false
        }
        if (fplx == "01" || fplx == "02" || fplx == "03" || fplx == "15") {
            flag = 0
        }
        var c = /^[0-9]*$/;
        var f = c.test(fpdm);
        if (f == false) {
            return false
        }
        if (adm(fpdm) && ahm(fphm) && acq(kprq) && ((flag == 0 && aje(fpdm, kjje)) || (flag == 1 && ajy(kjje))) && avym(yzm)) {
            return true
        }
        console.log('avai false');
        return false
    }
    function aur() {
        var fpdm = $("#fpdm").val().trim();
        var fphm = $("#fphm").val().trim();
        var kprq = $("#kprq").val().trim();
        var kjje = $("#kjje").val().trim();
        var yzm = $("#yzm").val().trim();
        if (fpdm == "" || fphm == "" || kprq == "" || kjje == "" || yzm == "" || yzm == "请输入验证码") {
            alert('请先输入各项信息！', '提示');
            return false
        } else {
            return true
        }
        return true
    }
    function getYzmxx() {
        var fpdm = $("#fpdm").val();
        var rad = Math.random();
        var swjginfo = getSwjg(fpdm, 0);
        var url = swjginfo[1] + "/yzmQuery";
        var nowtime = showTime().toString();
        var area = swjginfo[2];
        var param = {
            'fpdm': fpdm,
            'r': rad,
            'v': VVV,
            'nowtime': nowtime,
            'area': area,
            //'publickey': $.ckcode(fpdm, nowtime)
        };
        $.ajax({
            type: "post",
            url: url,
            data: param,
            dataType: "jsonp",
            jsonp: "callback",
            success: function(jsonData) {
                console.log(JSON.stringify(jsonData));
                //$api.attr($api.dom('#yzm_img'),'src','data:image/png;base64,'+ret.key1);
                delayFlag = "1";
                var key1 = jsonData.key1;
                var key2 = jsonData.key2;
                var key3 = jsonData.key3;
                var key4 = jsonData.key4;
                var key5 = jsonData.key5;
                if (typeof key5 === "undefined") {
                    oldweb = 1
                } else {
                    oldweb = 0
                } if (key1 == "003") {
                    alert("验证码请求次数过于频繁，请1分钟后再试！", "警告");
                    $('#yzm_img').hide()
                } else if (key1 == "005") {
                    alert("非法请求!", "警告")
                } else if (key1 == "010") {
                    alert("网络超时，请重试！(01)", "警告")
                } else if (key1 == "fpdmerr") {
                    alert("请输入合法发票代码!", "警告")
                } else if (key1 == "024") {
                    alert("24小时内验证码请求太频繁，请稍后再试！", "警告");
                    $('#yzm_img').hide()
                } else if (key1 == "016") {
                    alert("服务器接收的请求太频繁，请稍后再试！", "警告");
                    $('#yzm_img').hide()
                } else if (key1 == "020") {
                    alert("由于查验行为异常，涉嫌违规，当前无法使用查验服务！", "提示")
                } else if (key1 == "errv") {
                    alert("当前页面版本较低，请按CTRL-F5刷新页面！", "提示")
                } else if (key1 != "") {
                    fplx = alxd(fpdm);
                    $("#yzm_img").attr("src", "data:image/png;base64," + key1);
                    $("#yzm_unuse_img").attr("src", "data:image/png;base64," + key1);
                    if (key4 == '00') {
                        $("#yzminfo").text("请输入验证码文字")
                    } else if (key4 == '01') {
                        $("#yzminfo").html("请输入验证码图片中<font color=\"red\" size=\"4\" style=\"background:#C0C0C0\">红色</font>文字")
                    } else if (key4 == '02') {
                        $("#yzminfo").html("请输入验证码图片中<font color=\"yellow\" size=\"4\" style=\"background:#C0C0C0\">黄色</font>文字")
                    } else if (key4 == '03') {
                        $("#yzminfo").html("请输入验证码图片中<font color=\"blue\" size=\"4\" style=\"background:#C0C0C0\">蓝色</font>文字")
                    }
                    yzmSj = key2;
                    jmmy = key3
                }
            },
            timeout: 5000,
            error: function(XMLHttpRequest, textStatus, errorThrown) {
                if (retrycount == 9) {} else {
                    retrycount = retrycount + 1;
                    getYzmXx()
                }
            }
        });
    }
    function getSwjg(fpdm, ckflag) {
        var flag = "";
        var citys = [{
            'code': '1100',
            'sfmc': '北京',
            'Ip': 'https://zjfpcyweb.bjsat.gov.cn:443',
            'address': 'https://zjfpcyweb.bjsat.gov.cn:443'
        }, {
            'code': '1200',
            'sfmc': '天津',
            'Ip': 'https://fpcy.tjsat.gov.cn:443',
            'address': 'https://fpcy.tjsat.gov.cn:443'
        }, {
            'code': '1300',
            'sfmc': '河北',
            'Ip': 'https://fpcy.he-n-tax.gov.cn:82',
            'address': 'https://fpcy.he-n-tax.gov.cn:82'
        }, {
            'code': '1400',
            'sfmc': '山西',
            'Ip': 'https://fpcy.sx-n-tax.gov.cn:443',
            'address': 'https://fpcy.sx-n-tax.gov.cn:443'
        }, {
            'code': '1500',
            'sfmc': '内蒙古',
            'Ip': 'https://fpcy.nm-n-tax.gov.cn:443',
            'address': 'https://fpcy.nm-n-tax.gov.cn:443'
        }, {
            'code': '2100',
            'sfmc': '辽宁',
            'Ip': 'https://fpcy.tax.ln.cn:443',
            'address': 'https://fpcy.tax.ln.cn:443'
        }, {
            'code': '2102',
            'sfmc': '大连',
            'Ip': 'https://fpcy.dlntax.gov.cn:443',
            'address': 'https://fpcy.dlntax.gov.cn:443'
        }, {
            'code': '2200',
            'sfmc': '吉林',
            'Ip': 'https://fpcy.jl-n-tax.gov.cn:4432',
            'address': 'https://fpcy.jl-n-tax.gov.cn:4432'
        }, {
            'code': '2300',
            'sfmc': '黑龙江',
            'Ip': 'https://fpcy.hl-n-tax.gov.cn:443',
            'address': 'https://fpcy.hl-n-tax.gov.cn:443'
        }, {
            'code': '3100',
            'sfmc': '上海',
            'Ip': 'https://fpcyweb.tax.sh.gov.cn:1001',
            'address': 'https://fpcyweb.tax.sh.gov.cn:1001'
        }, {
            'code': '3200',
            'sfmc': '江苏',
            'Ip': 'https://fpdk.jsgs.gov.cn:80',
            'address': 'https://fpdk.jsgs.gov.cn:80'
        }, {
            'code': '3300',
            'sfmc': '浙江',
            'Ip': 'https://fpcyweb.zjtax.gov.cn:443',
            'address': 'https://fpcyweb.zjtax.gov.cn:443'
        }, {
            'code': '3302',
            'sfmc': '宁波',
            'Ip': 'https://fpcy.nb-n-tax.gov.cn:443',
            'address': 'https://fpcy.nb-n-tax.gov.cn:443'
        }, {
            'code': '3400',
            'sfmc': '安徽',
            'Ip': 'https://fpcy.ah-n-tax.gov.cn:443',
            'address': 'https://fpcy.ah-n-tax.gov.cn:443'
        }, {
            'code': '3500',
            'sfmc': '福建',
            'Ip': 'https://fpcyweb.fj-n-tax.gov.cn:443',
            'address': 'https://fpcyweb.fj-n-tax.gov.cn:443'
        }, {
            'code': '3502',
            'sfmc': '厦门',
            'Ip': 'https://fpcy.xm-n-tax.gov.cn',
            'address': 'https://fpcy.xm-n-tax.gov.cn'
        }, {
            'code': '3600',
            'sfmc': '江西',
            'Ip': 'https://fpcy.jxgs.gov.cn:82',
            'address': 'https://fpcy.jxgs.gov.cn:82'
        }, {
            'code': '3700',
            'sfmc': '山东',
            'Ip': 'https://fpcy.sd-n-tax.gov.cn:443',
            'address': 'https://fpcy.sd-n-tax.gov.cn:443'
        }, {
            'code': '3702',
            'sfmc': '青岛',
            'Ip': 'https://fpcy.qd-n-tax.gov.cn:443',
            'address': 'https://fpcy.qd-n-tax.gov.cn:443'
        }, {
            'code': '4100',
            'sfmc': '河南',
            'Ip': 'https://fpcy.ha-n-tax.gov.cn',
            'address': 'https://fpcy.ha-n-tax.gov.cn'
        }, {
            'code': '4200',
            'sfmc': '湖北',
            'Ip': 'https://fpcy.hb-n-tax.gov.cn:443',
            'address': 'https://fpcy.hb-n-tax.gov.cn:443'
        }, {
            'code': '4300',
            'sfmc': '湖南',
            'Ip': 'https://fpcy.hntax.gov.cn:8083',
            'address': 'https://fpcy.hntax.gov.cn:8083'
        }, {
            'code': '4400',
            'sfmc': '广东',
            'Ip': 'https://fpcy.gd-n-tax.gov.cn:443',
            'address': 'https://fpcy.gd-n-tax.gov.cn:443'
        }, {
            'code': '4403',
            'sfmc': '深圳',
            'Ip': 'https://fpcy.szgs.gov.cn:443',
            'address': 'https://fpcy.szgs.gov.cn:443'
        }, {
            'code': '4500',
            'sfmc': '广西',
            'Ip': 'https://fpcy.gxgs.gov.cn:8200',
            'address': 'https://fpcy.gxgs.gov.cn:8200'
        }, {
            'code': '4600',
            'sfmc': '海南',
            'Ip': 'https://fpcy.hitax.gov.cn:443',
            'address': 'https://fpcy.hitax.gov.cn:443'
        }, {
            'code': '5000',
            'sfmc': '重庆',
            'Ip': 'https://fpcy.cqsw.gov.cn:80',
            'address': 'https://fpcy.cqsw.gov.cn:80'
        }, {
            'code': '5100',
            'sfmc': '四川',
            'Ip': 'https://fpcy.sc-n-tax.gov.cn:443',
            'address': 'https://fpcy.sc-n-tax.gov.cn:443'
        }, {
            'code': '5200',
            'sfmc': '贵州',
            'Ip': 'https://fpcy.gz-n-tax.gov.cn:80',
            'address': 'https://fpcy.gz-n-tax.gov.cn:80'
        }, {
            'code': '5300',
            'sfmc': '云南',
            'Ip': 'https://fpcy.yngs.gov.cn:443',
            'address': 'https://fpcy.yngs.gov.cn:443'
        }, {
            'code': '5400',
            'sfmc': '西藏',
            'Ip': 'https://fpcy.xztax.gov.cn:81',
            'address': 'https://fpcy.xztax.gov.cn:81'
        }, {
            'code': '6100',
            'sfmc': '陕西',
            'Ip': 'https://fpcyweb.sn-n-tax.gov.cn:443',
            'address': 'https://fpcyweb.sn-n-tax.gov.cn:443'
        }, {
            'code': '6200',
            'sfmc': '甘肃',
            'Ip': 'https://fpcy.gs-n-tax.gov.cn:443',
            'address': 'https://fpcy.gs-n-tax.gov.cn:443'
        }, {
            'code': '6300',
            'sfmc': '青海',
            'Ip': 'https://fpcy.qh-n-tax.gov.cn:443',
            'address': 'https://fpcy.qh-n-tax.gov.cn:443'
        }, {
            'code': '6400',
            'sfmc': '宁夏',
            'Ip': 'https://fpcy.nxgs.gov.cn:443',
            'address': 'https://fpcy.nxgs.gov.cn:443'
        }, {
            'code': '6500',
            'sfmc': '新疆',
            'Ip': 'https://fpcy.xj-n-tax.gov.cn:443',
            'address': 'https://fpcy.xj-n-tax.gov.cn:443'
        }];
        var dqdm = null;
        var swjginfo = new Array();
        if (fpdm.length == 12) {
            dqdm = fpdm.substring(1, 5)
        } else {
            dqdm = fpdm.substring(0, 4)
        }
        if (dqdm != "2102" && dqdm != "3302" && dqdm != "3502" && dqdm != "3702" && dqdm != "4403") {
            dqdm = dqdm.substring(0, 2) + "00"
        }
        for (var i = 0; i < citys.length; i++) {
            if (dqdm == citys[i].code) {
                swjginfo[0] = citys[i].sfmc;
                if (flag == 'debug') {} else {
                    swjginfo[1] = citys[i].Ip + "/WebQuery";
                    swjginfo[2] = dqdm
                }
                break
            }
        }
        return swjginfo
    }

    function showTime() {
        var myDate = new Date();
        var time = myDate.getTime();
        return time
    }
</script>
</body>
</html>